from Excute import eval_func
import Excute
from Analyse import parser

Excute.init(parser)


def eval_str(code):
    node = parser.parse(code)
    eval_func(node)


def main():
    if len(sys.argv) < 2:
        eval_str('stop();')
        sys.exit(1)

    file_name = sys.argv[1]
    with open(file_name, 'r') as f:
        code = f.read()
    eval_str(code)


if __name__ == "__main__":
    main()
